home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1997 February
/
EnigmA AMIGA RUN 15 (1997)(G.R. Edizioni)(IT)[!][issue 1997-02][PLANET CD V].iso
/
enigma
/
earcd
/
utility
/
utilcli
/
mscclcmd.lha
/
ERP15.doc
< prev
next >
Wrap
Text File
|
1996-09-23
|
12KB
|
277 lines
EasyRequestPatch V1.5 by Chris Hodges
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Introduction
~~~~~~~~~~~~
A friend of mine once asked me, if I could write a little program for his
BBS that would cancel all the system-requesters that may appear, as his
harddisk brought up read/write errors which were not really existant.
So this is my first attempt for such a patch. I thought somebody had
already invented a program like this, but none of the asked sysops could
help.
The patch will kill any requester that matches a pattern given in a config
file. Other requesters will not be harmed at all.
I tried to make this program as secure and efficient as possible, and I
suppose this program is ;-)
Requirements
~~~~~~~~~~~~
EasyRequestPatch needs Kick 2.04 or higher and about 12 KB of memory.
Usage
~~~~~
Run >NIL: ERP [configfile] [QUIT] [LOGFILE filename] [QUIET]
(Template: CONFIG,QUIT/S,LOGFILE/K,QUIET/S)
As you can see, the program does not unhook itself. The config file must be
specified if you install the patch, to remove the patch again, ERP QUIT is
sufficient. If you want to get a logfile of all activities, you can add the
LOGFILE argument with the filename where all the data should be saved. If
this file already exists, the new text will be appended. The file has
shared access, will be only written into in 2 minutes intervals and is
closed after each writing operation, so you can have a look at it at any
time.
Configuration
~~~~~~~~~~~~~
An example configuration file has been included in the archive.
The configuration file is a normal AmigaDOS ascii-text. It may *NOT*
contain other line seperators than linefeeds (no CRs allowed!).
Empty lines and characters after a semicolon are ignored.
A configuration line looks like this:
pattern,(delay,gadgetnum,retries)
or
pattern,(delay,gadgetnum,retries),(delay,gadgetnum,retries),... etc.
The pattern string may contain any normal dos jokers. Use quotemarks where
required. Behind the pattern you have to enter at least one group
containing three defining values. You can define up to five such groups.
delay is used to specify the time to pass before ERP answers the requester
with the given gadget number. These delays have to be entered in units of
1/50 secs.
This action will be repeated until the requester shuts up or the number of
retries has been overridden. If this happens, the next group will be taken
for the requester, or if it already has been the last group, the requester
will pop up as usually.
The gadgets in each requester are placed in ascending order from 1 to N-1,
whereas N represents the total amount of gadgets in the dialogue box. The
last gadget (often 'Cancel') is always gadget number 0.
There are few 'special' gadgetnumbers:
-1: Is used to behave as if an IDCMP event has occurred (often this has the
same result as clicking on the 'Retry' gadget).
-2: Just waits the amount of time you give with the delay instruction.
-3: Flashes the display and beeps the given number of times.
-4: Resets the computer after the given delay. Please note that this delay
should be at least 5 seconds (=250 ticks), to ensure that all disk
activity (e.g the logfile) has been stopped.
-5: Like -4, but kills the exec base to avoid a guru meditation on bootup.
There's no need to do that on kick 3.x machines as the guru has a time
out check from kick 3.x on.
Note that the patterns are proccessed in that order they have been entered
into. There can be as many pattern definitions as you like.
Version V1.5 introduces new configuration variables for use within the
config file. Lines containing variables must begin with a '@' symbol. The
parameter can be either a '+' (plus) to activate the variable or a '-'
(minus) to deactivate the function or a number. Whatever you use, it has to
be placed directly behind the variable, so there mustn't be a space between
them. You can enter multiple variables into one line seperated by a space.
The variables are case sensitive (currently).
These are the currently available variables:
taskpri : Sets the task priority for ERP. Only negative values from
-127 to -1 are allowed. By default, the task priority will
not be changed.
checkdelay : This value contains the amount of ticks between the check in
the main loop. Setting it to a high value will use up less
cpu time (not much really). You should not enter higher
values than 500. Default is 10.
remembertime : Contains the amount of ticks the last requester should be
remembered (see Notes for more details). Should be at least
100 and more than checkdelay.
logupdatetime: This is the time, after which the logfile should be updated.
Can be any value you want, but keep it above the checkdelay
value. Default is 6000.
logtime : If set to '+' the logfile then contains the time when a
requester had been called. This is default.
logdate : If set to '+' the log will be saved along with the date of
the event. Default is '-'.
logtaskname : Setting this to '+' will save the name of the task causing
the requester. Default is '-'.
logreqtext : Normally, the body of the requester will be saved in the
logfile. You can disable this using 'logreqtext-'.
maxtextlen : Sets the maximum length of the requester text to be saved.
Default is 48.
textnospace : To get more information into the limited space, the
requester text will be normally shortened by cutting out all
it's space characters. This can be disabled using the
'textnospace-' option.
Notes
~~~~~
Due to the dynamic linked lists used in this program, it could happen that
this program fragmentates your memory. To prevent this I use reversed
memory allocation to avoid little scattered memory blocks.
These linked lists are required to distinguish between different requester
coming from different tasks. As there is no possibility to check whether a
requester has been killed successfully (i.e the program is satisfied with
the result and does not opens the requester again), the program reserves
some memory to save some information about the requester. If the same
requester appears within ten seconds ERP acts according to the group
behaviour. Otherwise the memory is freed and the old requester will be
forgotten.
History
~~~~~~~
V1.5 (11-Nov-95):
~~~~~~~~~~~~~~~~~
- Helau!
- Arrrggglll! Due to a typing mistake (FreeMem instead of FreeVec), in V1.4
every patch call would eat up 4 KB of memory which wasn't freed anymore.
Fixed.
- Yeah! Added configuration variables. Now every single thing can be set up
from the config file.
- Fixed a bug which displayed a random line number if the config file had
an error.
- Added LOGFILE option. A shared lock file will be used for this purpose so
you can have a look at it at any time.
- Added QUIET option. Now only error messages will be sent to the cli
window.
V1.4 (30-Oct-95):
~~~~~~~~~~~~~~~~~
- Logical error with the stack problem. If the patch is called the second
time it runs through it's routines, the stack space clashed. This is
fixed now.
- Now uses real exec semaphores.
V1.3 (01-Oct-95):
~~~~~~~~~~~~~~~~~
- No stack problems anymore. Now uses it's own stack for the patch routine.
V1.2 (25-Aug-95):
~~~~~~~~~~~~~~~~~
- Crashed on MC68000 due to one (!) accidentially used 68020 instructions.
Fixed.
- Not enough stack will pop up the requester now.
- Added stack checking. Now it cannot crash anymore due to too few stack.
Minimum stack required for pattern matching: 1500 bytes.
- Moved the pattern token creation to the config parsing, so the patch has
become a little big faster.
- The bug with the Ctrl-C key doesn't appear anymore.
V1.1 (28-Jul-95):
~~~~~~~~~~~~~~~~~
- Since there were problems with read write errors, I've set the maximum
quantum up again to 10 seconds.
- Fixes some little bugs which caused the requester to be forgotten too
early.
- The fixes didn't help at all. Seems as if read/write errors lock up the
dos output routines, so I have added a new linked list containing the
output strings so they can be printed by the main program. This allows me
to use buffered string printing again. Now it finally *should* run
correctly.
- Those little annoying bugs... logical mistake locked the output buffer
list during output so the requester hung again. Fixed using another
little buffer. If it now doesn't run, I'll give it up.
V1.0 (26-Jul-95):
~~~~~~~~~~~~~~~~~
- The logfile was a little bit faulty due to the mixed usage of buffered
and non-buffered writing. This has been fixed now.
- Changed the main loop quantum from 1 VBL delay to 10 VBLs. This will
reduce the cpu usage.
- Changed the requester-timeout to two seconds instead of one.
- Modified the parser to check for more errors.
- Increased the general buffers a bit.
- Strange things seem to happen: The last program opening a requester, will
get the control-c signal passed through. No clue why this happens and how
to prevent it. Please use 'ERP Quit' instead of the Ctrl-C key.
- Added the wait and reset events.
- Added the beep and hard reset events.
V1.0ß (25-Jul-95):
~~~~~~~~~~~~~~~~~~
- First release. Works quite well.
Copyright notice
~~~~~~~~~~~~~~~~
EasyRequestPatch (ERP) and it's documentation are Copyright © 1995 by Chris
Hodges. All rights reserved.
Disclaimer
~~~~~~~~~~
EasyRequestPatch has proven to be stable in everyday use. The author is not
responsible for any loss of data, damages to software or hardware that may
result directly or indirectly from the use of this program. The author
reserves the right to make changes to the software or documentation without
notice.
Bugreports and comments are appreciated. Please send them to the email
address below.
Shareware note
~~~~~~~~~~~~~~
This program is free distributable, this means that you can copy it freely
as long as you don't ask any more money for it than a nominal fee for
copying. If you want to distribute this program you must keep this document
with it. This program cannot be used for commercial purposes without
written permission from the author.
None of the files of the ERP package may be modified or left out without
permission of the author. Crunching or archiving is allowed only if none of
the ERP files get modified by it. Adding BBS adverts or similar to such an
archive is forbidden.
Moreover, it is forbidden to use ERP following conditions:
- For construction, development, creation or testing of weapons or
any other types of arms.
- Your name is Marc Stachel (better known as Charlie/KF) or
Florian Graßinger (Mirage/KF).
ERP may not be included in archives containing the mailbox software
'FastCall' or 'Prometheus' nor in archives with indirect or direct Krypton
Force productions.
If you use this program regularily, the author would appreciate any
donation you could give him, otherwise you'll should not use ERP any
longer! Especially SysOps could register this program as they really may
need ERP for his/her BBS.
ERP registration counter: 0001 (=US$10 in total)
Contact address
~~~~~~~~~~~~~~~
Any mails or donations to:
Chris Hodges Account: 359 68 63
Kennedystr. 8 BLZ : 700 530 70
D-82178 Puchheim Bank : Sparkasse Fürstenfeldbruck
Germany
Tel.: +49-89/8005856
Email: chris@sixpack.pfalz.de